package java69.work721;
//梯形
public class Trapezoid extends Base{
    private double top;;
    private double bottom;
    private double high;
    private double liftHypotebuse;
    private double rightHypotebuse;
    public Trapezoid() {
    }

    public Trapezoid(double top, double bottom, double high, double liftHypotebuse, double rightHypotebuse) {
        this.top = top;
        this.bottom = bottom;
        this.high = high;
        this.liftHypotebuse = liftHypotebuse;
        this.rightHypotebuse = rightHypotebuse;
    }

    public double getTop() {
        return top;
    }

    public void setTop(double top) {
        this.top = top;
    }

    public double getBottom() {
        return bottom;
    }

    public void setBottom(double bottom) {
        this.bottom = bottom;
    }

    public double getHigh() {
        return high;
    }

    public void setHigh(double high) {
        this.high = high;
    }

    public double getLiftHypotebuse() {
        return liftHypotebuse;
    }

    public void setLiftHypotebuse(double liftHypotebuse) {
        this.liftHypotebuse = liftHypotebuse;
    }

    public double getRightHypotebuse() {
        return rightHypotebuse;
    }

    public void setRightHypotebuse(double rightHypotebuse) {
        this.rightHypotebuse = rightHypotebuse;
    }

    @Override
    public void area( ) {
        double areas = ((this.top+this.bottom)*this.high)/2;
        System.out.println("面积为"+areas);
    }

    @Override
    public void perimeter() {
        double perimeter = this.bottom+this.top+this.liftHypotebuse+this.rightHypotebuse;
        System.out.println("周长为"+perimeter);
    }
}
